﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace VGS {
    public class Player {
        private string shirt; // Can actually contain letters
        private string name;
        
        // dictionary containing setId (as key) and then a playerstatistics object for that set
        private Dictionary<int, PlayerStatistics> stats = new Dictionary<int, PlayerStatistics>();

        public Player() { }

        #region Constructor
        /// <summary>
        /// Constructor. Takes the player's shirt number and name.
        /// </summary>
        /// <param name="nr">Player's shirt number</param>
        /// <param name="name">Player's name</param>
        public Player(string shirt, string name)
        {
            this.shirt = shirt;
            this.name = name;
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets the player's shirt number
        /// </summary>
        [XmlElement]
        public string Shirt
        {
            get {
                return shirt;
            }
        }

        /// <summary>
        /// Gets the player's name
        /// </summary>
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }

        [XmlIgnore]
        public Dictionary<int, PlayerStatistics> Stats
        {
            get
            {
                return stats;
            }
        }
        #endregion
    }
}
